﻿<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false"
    CodeFile="NetworkTypeMaintain.aspx.vb" Inherits="WebForm_Manage_NetworkTypeMaintain" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
         <table width="100%">
                <tr>
                    <td style="text-align: center">
                        <asp:Label ID="lblTitle" runat="server" Font-Bold="True" Font-Size="24px" meta:resourcekey="lblTitle"></asp:Label>
                    </td>
                </tr>
            </table>
            <table>
                <tr style="vertical-align: text-top">
                    <td>
                        <asp:HiddenField ID="hiUID" runat="server" />
                        <asp:HiddenField ID="hiKind" runat="server" />
                        
                        <br />
                        <asp:Label ID="lblsuit_site" runat="server" meta:resourcekey="lblsuit_site"></asp:Label>
                        <asp:DropDownList ID="ddlsuit_site" runat="server" AutoPostBack="True" DataSourceID="objDSsite"
                            DataTextField="site_name" DataValueField="site_code">
                        </asp:DropDownList>
                        <asp:Button ID="btnInsert" runat="server" meta:resourcekey="btnInsert" />
                        <br />
                        <asp:ObjectDataSource ID="objDSsite" runat="server" SelectMethod="GetAllSite" TypeName="Telecom.BBL.SiteBBL">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                        <asp:ObjectDataSource ID="objDSNetworkType" runat="server" SelectMethod="GetNetworkType"
                            TypeName="Telecom.BBL.NetWorkTypeBBL" UpdateMethod="UpdateNetworkType">
                            <UpdateParameters>
                                <asp:Parameter Name="canModi" Type="Boolean" />
                                <asp:Parameter Name="network_no" Type="String" />
                                <asp:Parameter Name="network_name" Type="String" />
                                <asp:ControlParameter ControlID="ddlsuit_site" Name="network_site" PropertyName="SelectedValue"
                                    Type="String" />
                                <asp:Parameter Name="network_desc" Type="String" />
                                <asp:Parameter Name="NeedApprove" Type="Int16" />
                                <asp:Parameter Name="Message" Type="String" />
                                <asp:ControlParameter ControlID="hiUID" Name="UID" PropertyName="Value" Type="String" />
                                <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" Type="String" />
                            </UpdateParameters>
                            <SelectParameters>
                                <asp:ControlParameter ControlID="ddlsuit_site" Name="network_site" PropertyName="SelectedValue"
                                    Type="String" />
                                <asp:ControlParameter ControlID="hiKind" ConvertEmptyStringToNull="False" Name="Kind"
                                    PropertyName="Value" Type="String" />
                                <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" Type="String" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                        <asp:HiddenField ID="hiDBName" runat="server" />
                        <TServerControl:TGridView ID="gvNetWorklType" runat="server" AllowHoverEffect="True"
                            AllowHoverSelect="True" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="objDSNetworkType"
                            ShowFooterWhenEmpty="False" ShowHeaderWhenEmpty="True" SkinID="pager" TotalRowCount="0">
                            <Columns>
                                <asp:TemplateField>
                                    <EditItemTemplate>
                                        <asp:Button ID="btnUpdate" runat="server" CommandName="Update" meta:resourcekey="btnUpdate" />
                                        <asp:Button ID="btnCancel" runat="server" CommandName="Cancel" meta:resourcekey="btnCancel" />
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Button ID="btnEdit" runat="server" CommandName="Edit" meta:resourcekey="btnEdit"
                                            Text="Button" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="type_code">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txttype_code" runat="server" Enabled='<%# Bind("canModi") %>' Text='<%# Bind("network_no") %>'
                                            Width="68px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lbltype_code" runat="server" Text='<%# Bind("network_no") %>' Width="68px"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="type_name">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txttype_name" runat="server" Text='<%# Bind("network_name") %>'
                                            Width="68px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lbltype_name" runat="server" Text='<%# Bind("network_name") %>' Width="68px"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="type_desc">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txttype_desc" runat="server" Text='<%# Bind("network_desc") %>'
                                            Width="68px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lbltype_desc" runat="server" Text='<%# Bind("network_desc") %>' Width="68px"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="NeedApprove">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtNeedApprove" runat="server" Text='<%# Bind("NeedApprove") %>'
                                            Width="68px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lblNeedApprove" runat="server" Text='<%# Bind("NeedApprove") %>' Width="68px"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                       <asp:TemplateField meta:resourcekey="Message">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtMessage" runat="server" Text='<%# Bind("Message") %>'
                                            Width="120px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lblMessage" runat="server" Text='<%# Bind("Message") %>' 
                                            Width="120px"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="ChkOA">
                                    <EditItemTemplate>
                                        <asp:CheckBox ID="cbChkOA" Checked='<%# Bind("ChkOA") %>' runat="server" />
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="cbChkOA" Checked='<%# Bind("ChkOA") %>' runat="server" Enabled="False" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField meta:resourcekey="FirstPay">
                                    <EditItemTemplate>
                                        <asp:CheckBox ID="cbFirstPay" Checked='<%# Bind("FirstPay") %>' runat="server" />
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="cbFirstPay" Checked='<%# Bind("FirstPay") %>' runat="server" Enabled="False" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="CrtName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCrtName" runat="server" Text='<%# Eval("CrtName") %>' Width="68px"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="CrtDate">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCrtDate" runat="server" Text='<%# Eval("CrtDate","{0:d}") %>' Width="68px"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="ModiName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblModiName" runat="server" Text='<%# Eval("ModiName") %>' Width="68px"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="ModiDate">
                                    <ItemTemplate>
                                        <asp:Label ID="lblModiDate" runat="server" Text='<%# Eval("ModiDate","{0:d}") %>'
                                            Width="68px"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="Function">
                                    <EditItemTemplate>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Button ID="btnSetup" CommandName="Select" runat="server" meta:resourcekey="btnSetup"
                                            CommandArgument='<%# Bind("network_no") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </TServerControl:TGridView>
                        <br />
                    </td>

                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="up" runat="server">
        <ContentTemplate>
            <asp:Panel ID="Panel1" runat="server" BackColor="#E7FEC2"  BorderWidth="1" Style="cursor: move;" Width="600px">
                <table>
                    <tr>
                        <td>
                            <br />
                            <asp:HiddenField ID="hiKindDetail" runat="server" />
                            <asp:HiddenField ID="hinetwork_no" runat="server" />
                            <asp:Button ID="btnInsertDetail" runat="server" meta:resourcekey="btnInsert" Visible="False" />
                            <asp:ObjectDataSource ID="objDSTypeNetworkType" runat="server" SelectMethod="GetTypeNetworkType"
                                TypeName="Telecom.BBL.NetWorkTypeBBL" UpdateMethod="TypeNetworkTypeInsert" DeleteMethod="DeleteTypenetwork_no">
                                <DeleteParameters>
                                    <asp:ControlParameter ControlID="hinetwork_no" Name="network_no" PropertyName="Value"
                                        Type="String" />
                                    <asp:ControlParameter ControlID="ddlsuit_site" Name="network_site" PropertyName="SelectedValue"
                                        Type="String" />
                                    <asp:Parameter Name="type_code" Type="String" />
                                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" Type="String" />
                                </DeleteParameters>
                                <UpdateParameters>
                                    <asp:ControlParameter ControlID="ddlsuit_site" Name="network_site" PropertyName="SelectedValue"
                                        Type="String" />
                                    <asp:ControlParameter ControlID="hinetwork_no" Name="network_no" PropertyName="Value"
                                        Type="String" />
                                    <asp:Parameter Name="type_code" Type="String" />
                                    <asp:ControlParameter ControlID="hiUID" Name="UID" PropertyName="Value" Type="String" />
                                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" Type="String" />
                                </UpdateParameters>
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="ddlsuit_site" Name="network_site" PropertyName="SelectedValue"
                                        Type="String" />
                                    <asp:ControlParameter ControlID="hinetwork_no" Name="network_no" PropertyName="Value"
                                        Type="String" />
                                    <asp:ControlParameter ControlID="hiKindDetail" ConvertEmptyStringToNull="False" Name="Kind"
                                        PropertyName="Value" Type="String" />
                                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" Type="String" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <asp:ObjectDataSource ID="objDSTelType" runat="server" SelectMethod="GetTelType"
                                TypeName="Telecom.BBL.TelTypeBBL">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="ddlsuit_site" Name="suit_site" PropertyName="SelectedValue"
                                        Type="String" ConvertEmptyStringToNull="False" />
                                    <asp:Parameter ConvertEmptyStringToNull="False" DefaultValue="  " Name="Kind" Type="String" />
                                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" Type="String"
                                        DefaultValue="" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <TServerControl:TGridView ID="gvTypeNetWorklType" runat="server" AllowHoverEffect="True"
                                AllowHoverSelect="True" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="objDSTypeNetworkType"
                                ShowFooterWhenEmpty="False" ShowHeaderWhenEmpty="True" SkinID="pager" TotalRowCount="0"
                                Visible="False" >
                                <Columns>
                                    <asp:TemplateField>
                                        <EditItemTemplate>
                                            <asp:Button ID="btnUpdate" runat="server" CommandName="Update" meta:resourcekey="btnUpdate" />
                                            <asp:Button ID="btnCancel" runat="server" CommandName="Cancel" meta:resourcekey="btnCancel" />
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Button ID="btnDelete" runat="server" CommandName="Delete" meta:resourcekey="btnDelete"
                                                CommandArgument='<%# Eval("type_code") %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField meta:resourcekey="Applytype_code">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlTelType" runat="server" DataSourceID="objDSTelType" DataTextField="type_name"
                                                DataValueField="type_code" SelectedValue='<%# Bind("type_code") %>'>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lbltype_code" runat="server" Text='<%# Bind("type_name") %>' Width="68px"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    
                                    <asp:TemplateField meta:resourcekey="CrtName">
                                        <ItemTemplate>
                                            <asp:Label ID="lblCrtName" runat="server" Text='<%# Eval("CrtName") %>' Width="68px"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField meta:resourcekey="CrtDate">
                                        <ItemTemplate>
                                            <asp:Label ID="lblCrtDate" runat="server" Text='<%# Eval("CrtDate","{0:d}") %>' Width="68px"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </TServerControl:TGridView>
                        </td>
                     </tr>
                     <tr>
                        <td align="center">
                            <asp:Button ID="btnCancel" runat="server" Text="<%$ Resources:Cancel%>" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Button ID="btnDummy" runat="server" Style="display: none" SkinID="null" />
            <ajaxToolkit:ModalPopupExtender ID="mpSearch" runat="server" TargetControlID="btnDummy" X ="30" 
            PopupControlID="panel1" CancelControlID="btnCancel" PopupDragHandleControlID="panel1" />

        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
